Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4009] Clean up usage of merged data #4110

Merged
merged 6 commits into from
Apr 4, 2024
Merged

Conversation

Viicos
Copy link
Contributor

@Viicos Viicos commented Apr 3, 2024

Fixes #4009, #979.

As said in the issue, I'm not able to reproduce the sdk rendering bug anymore on latest.

This PR can safely be reviewed commit per commit.

Comment on lines 18 to 26
def _get_printable_data(submission: Submission) -> list[tuple[str, Any]]:
printable_data: list[tuple[str, Any]] = []
merged_data = submission.get_merged_data()

for component in filter_printable(submission.form.iter_components(recursive=True)):
key = component["key"]
value = format_value(component, merged_data.get(key), as_html=False)
printable_data.append((component.get("label", key), value))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function was already adapted in d7b63bd, and figured it was still relevant as it was kept as well in this commit (while the other uses of submission.get_printable_data() were removed).

Viicos added 2 commits April 3, 2024 15:49
In the future, the `data` property could also
be removed, to enforce people using the state wrapper
instead.
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.10%. Comparing base (aa8cce3) to head (d6c54da).
Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4110      +/-   ##
==========================================
- Coverage   96.10%   96.10%   -0.01%     
==========================================
  Files         730      730              
  Lines       23089    23079      -10     
  Branches     2698     2697       -1     
==========================================
- Hits        22189    22179      -10     
  Misses        638      638              
  Partials      262      262              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sergei-maertens
Copy link
Member

Latest is still broken, there's a minimum repro on our test environment.

@Viicos Viicos force-pushed the issue/4009-cleanup branch from 88d411b to d6c54da Compare April 4, 2024 07:36
@sergei-maertens sergei-maertens merged commit ad25a10 into master Apr 4, 2024
25 of 27 checks passed
@sergei-maertens sergei-maertens deleted the issue/4009-cleanup branch April 4, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block/discourage the use of dots in component keys?
2 participants